#pragma once
#include <unordered_map>
#include "Hash.h"
#include "ILocation.h"
#include "ImportExport.h"

namespace ja2{ namespace vfs
{
	//! Directory location.
	class DirectoryLocation : public ILocation
	{
		// Typedefs
	private:
		typedef std::unordered_map<boost::filesystem::path, DirectoryPtr_t, hash_path> DirCatalog_t;

		// Nested class
	private:
		class IteratorImpl;

		// Attributes
	private:
		//! Dir catalog.
		DirCatalog_t m_CatDirs;
		//! Real path of location.
		boost::filesystem::path const m_RealPath;

		// Operations
	public:
		//! See base.
		virtual DirectoryPtr_t get_dir(boost::filesystem::path const &File) const;
		//! See base.
		virtual bool dir_exist(boost::filesystem::path const &File) const;
		//! See base.
		virtual boost::filesystem::path const &get_path() const;
		//! See base.
		virtual Iterator begin();
		//! See base.
		virtual Iterator end();

		// Construction/Destruction
	public:
		JA2_VFS_API DirectoryLocation(boost::filesystem::path const &MountPoint, boost::filesystem::path const &RealPath, boost::filesystem::path const &WrkPath);
	};
} /*vfs*/} /*ja2*/
